{include file="public/header" /}
<body>
<div class="layui-tab layui-tab-brief main-tab-container">
    <ul class="layui-tab-title main-tab-title">
        <li class="layui-this">公告添加</li>
        <div class="main-tab-item">内容管理</div>
    </ul>
    <div class="layui-tab-content">
        <form class="layui-form" onsubmit="return false;">
            <div class="layui-tab-item layui-show">
                <div class="layui-form-item">
                    <label class="layui-form-label">公告名称</label>
                    <div class="layui-input-inline input-custom-width">
                        <input type="text" name="title" value="" lay-verify="required" autocomplete="off" placeholder="请输入标题" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">作者</label>
                    <div class="layui-input-inline input-custom-width">
                        <input type="text" name="author" required lay-verify="required" placeholder="默认为当前管理员" autocomplete="off" class="layui-input" value="{$Think.session.username}">
                    </div>
                    <div class="layui-form-mid layui-word-aux"></div>
                </div>


                <div class="layui-form-item">
                    <label class="layui-form-label">公告内容</label>
                    <div class="layui-input-block" style="z-index:100">
                        <script id="container" name="content" type="text/plain" style="width:600px;height:500px;"></script>
                        <input type="hidden" name="create_time" >
                            <input type="hidden" name="update_time" >
                            </div>
                            </div>
                            <div class="layui-form-item">
                            <div class="layui-input-block">
                            <button class="layui-btn" lay-submit="" lay-filter="feedback_edit" id="sbtn">立即添加</button>
                            </div>
                            </div>
                            </div>
                            </form>
                            </div>
                            </div>
                            <!-- 配置文件 -->
                            <script type="text/javascript" src="__PUBLIC__ue/ueditor.config.js"></script>
                        <!-- 编辑器源码文件 -->
                        <script type="text/javascript" src="__PUBLIC__ue/ueditor.all.js"></script>
                        <script type="text/javascript">
                            var ue = UE.getEditor('container');
                            //添加操作
                            $(".layui-btn").click(function(){
                                $.ajax({
                                    url: "{:url('notice/add_notice')}",
                                    data: $("form").serialize(),
                                    type: "POST",
                                    datatype:"json",
                                    success: function( result ) {
                                        layer.open({
                                            title: '信息'
                                            ,content: '添加成功！'
                                        });
                                    }
                                });
                            });
                            layui.use(['element', 'layer', 'form'], function(){
                                var element = layui.element()
                                    ,jq = layui.jquery
                                    ,form = layui.form()
                                    ,laypage = layui.laypage;

                            })
                        </script>
</body>
</html>